package com.ethan.threadPool.Servcie;

/**
 * @author ethan
 * create 2018-07-23 下午9:00
 * desc
 **/
public class Service implements IService {
    final static String orderNo ="xep123";
    @Override
    public FlightSegment getFlightSegment(String orderNo) throws InterruptedException {
        if(!orderNo.equals(orderNo)){
            return null;
        }
        Thread.sleep(2000);
        return FlightSegment.builder().flightNo(orderNo).price(Double.valueOf("200")).build();
    }

    @Override
    public Insurance getInsurance(String orderNo) throws InterruptedException {
        if(!orderNo.equals(orderNo)){
            return null;
        }
        Thread.sleep(2000);
        return Insurance.builder().orderNo(orderNo).price(Double.valueOf("30")).build();
    }
}
